Posit::conf (2023)
XKCD: Python Environment
Calvin Hendryx-Parker: Bootstrapping Your Local Python Environment
pyenv!requirements.txtvenvREADME.mdrequirements.txtIt’s a pyenv plugin
Uses built-in venv
Makes it a bit easier to install everything in 1 place and list it
pyenv doesn’t support pluginsvenvvenvpyenv local, pyenv shellvenv:$ python -m venv venv # will create a venv folder in your working directory
$ python -m venv .venv # will create a .venv folder in your working directoryvenv:$ source venv/bin/activate # on mac / linux
C:\> venv/Scripts\activate.bat # on windows, use Activate.ps1 for powershell
pyenv cheatsheetwhich python: will always point to pyenv
pyenv which python: give you the path to python in usepyenv versions: See all installed versions and which one in usepyenv install --list: list all available python to install
pyenv install --list | grep 3.11: list all python 3.11.xpyenv install 3.11.5: install python 3.11.5pyenv global <PYTHON VERSION>: sets the default pythonpyenv local <PYTHON VERSION>: creates a .python-version filepyenv shell <PYTHON VERSION>: uses <PYTHON VERSION> right now